package com.rran.study.designpattern.behavioral.strategy.strategy.spring;

import com.rran.study.designpattern.behavioral.strategy.annotation.PayAction;
import com.rran.study.designpattern.behavioral.strategy.model.PayContext;
import com.rran.study.designpattern.behavioral.strategy.strategy.PayStrategy;
import org.springframework.stereotype.Component;

/**
 * @author yy
 * @Type WeChatSpringPayStrategy.java
 * @Desc
 * @date 2020/7/20 11:44
 */
@Component
@PayAction(payName = "WECHAT")
public class WeChatSpringPayStrategy extends AbstractPayStrategy {

    private final String STRATEGY = "微信支付";

    @Override
    public void pay(PayContext payContext) {
        System.out.println(payContext.getName()+"使用"
        +STRATEGY+payContext.getPrice()+"元");
    }
}
